<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        #wrap{
            width: 300px;
            height: 300px;
            background: pink;
        }
        #inner{
            width: 200px;
            height: 200px;
            background: deeppink;
        }
        #test{
            width: 100px;
            height: 100px;
            background: gray;
        }
    </style>
</head>
<body>
    <div id="app">
        <button v-on:click="handleC">{{msg}}</button>
        <button @click="handleC">{{msg}}</button>

        <div id="wrap" @click="wrapFn">
            <div id="inner" @click.stop="innerFn">
                <div id="test" @click="testFn">

                </div>
            </div>
        </div>

        <a href="http://www.atguigu.com" @click.prevent="aFn">回娘家</a>

        <input type="text" @keyDown.13="keyDownFn">
    </div>
</body>
<script src="./js/vue.js"></script>
<script>
    var test = "test";

    Vue.config.productionTip = false;

    var vm = new Vue({
        el:"#app",
        data:{
            msg:"点我啊"
        },
        methods:{
            handleC(){
                console.log("button click")
            },
            testFn(){
                console.log("testFn")
            },
            innerFn(){
                console.log("innerFn")
            },
            wrapFn(){
                console.log("wrapFn")
            },
            aFn(){
                alert("aFn")
            },
            keyDownFn(){
                console.log("keyDownFn")
            }
        }
    })
</script>
</html>